3.288 \(\int (a+b \sin ^2(e+f x)) \, dx\)

Optimal. Leaf size=30 \[ a x-\frac {b \sin (e+f x) \cos (e+f x)}{2 f}+\frac {b x}{2} \]

[Out]

a*x+1/2*b*x-1/2*b*cos(f*x+e)*sin(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {2635, 8} \[ a x-\frac {b \sin (e+f x) \cos (e+f x)}{2 f}+\frac {b x}{2} \]

Antiderivative was successfully verified.

[In]

Int[a + b*Sin[e + f*x]^2,x]

[Out]

a*x + (b*x)/2 - (b*Cos[e + f*x]*Sin[e + f*x])/(2*f)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rubi steps

\begin {align*} \int \left (a+b \sin ^2(e+f x)\right ) \, dx &=a x+b \int \sin ^2(e+f x) \, dx\\ &=a x-\frac {b \cos (e+f x) \sin (e+f x)}{2 f}+\frac {1}{2} b \int 1 \, dx\\ &=a x+\frac {b x}{2}-\frac {b \cos (e+f x) \sin (e+f x)}{2 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 33, normalized size = 1.10 \[ a x+\frac {b (e+f x)}{2 f}-\frac {b \sin (2 (e+f x))}{4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[a + b*Sin[e + f*x]^2,x]

[Out]

a*x + (b*(e + f*x))/(2*f) - (b*Sin[2*(e + f*x)])/(4*f)

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 29, normalized size = 0.97 \[ \frac {{\left (2 \, a + b\right )} f x - b \cos \left (f x + e\right ) \sin \left (f x + e\right )}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(f*x+e)^2,x, algorithm="fricas")

[Out]

1/2*((2*a + b)*f*x - b*cos(f*x + e)*sin(f*x + e))/f

________________________________________________________________________________________

giac [A]  time = 0.13, size = 26, normalized size = 0.87 \[ \frac {1}{4} \, b {\left (2 \, x - \frac {\sin \left (2 \, f x + 2 \, e\right )}{f}\right )} + a x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(f*x+e)^2,x, algorithm="giac")

[Out]

1/4*b*(2*x - sin(2*f*x + 2*e)/f) + a*x

________________________________________________________________________________________

maple [A]  time = 0.07, size = 32, normalized size = 1.07 \[ a x +\frac {b \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*sin(f*x+e)^2,x)

[Out]

a*x+b/f*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)

________________________________________________________________________________________

maxima [A]  time = 0.36, size = 29, normalized size = 0.97 \[ a x + \frac {{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(f*x+e)^2,x, algorithm="maxima")

[Out]

a*x + 1/4*(2*f*x + 2*e - sin(2*f*x + 2*e))*b/f

________________________________________________________________________________________

mupad [B]  time = 13.65, size = 27, normalized size = 0.90 \[ -\frac {\frac {b\,\sin \left (2\,e+2\,f\,x\right )}{4}-f\,x\,\left (a+\frac {b}{2}\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a + b*sin(e + f*x)^2,x)

[Out]

-((b*sin(2*e + 2*f*x))/4 - f*x*(a + b/2))/f

________________________________________________________________________________________

sympy [A]  time = 0.25, size = 51, normalized size = 1.70 \[ a x + b \left (\begin {cases} \frac {x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {\sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \sin ^{2}{\relax (e )} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(f*x+e)**2,x)

[Out]

a*x + b*Piecewise((x*sin(e + f*x)**2/2 + x*cos(e + f*x)**2/2 - sin(e + f*x)*cos(e + f*x)/(2*f), Ne(f, 0)), (x*
sin(e)**2, True))

________________________________________________________________________________________